#include "computeserver.hh"

#include <stdlib.h>

using namespace std;

int main(int ac, char ** av)
{
    char car;
    ComputeServer server;

    if (ac == 3)
    {
        server = ComputeServer(av[1], atoi(av[2]));
    }
    else
    {
        cerr << "Usage: ./ComputeServer.bin 'address' 'port'" << endl;
        return (1);
    }

    server.Start();

    cout << "Press 'q'' or 'ctrl + d' to quit" << endl;
    while (cin >> car)
    {
        if (car == 'q' || car == '\0')
        {
            server.Stop();
            break;
        }
    }

    return (0);
}
